Skip to content

Comments

Task 11#1

Open
AntonHrbnts wants to merge 17 commits intomainfrom
Task-11-POST
Open

Task 11#1
AntonHrbnts wants to merge 17 commits intomainfrom
Task-11-POST

Conversation

@AntonHrbnts
Copy link
Owner

No description provided.

});

if (count) {
return { count: filteredData.length };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot about filteredData

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

const dangerousMeteors = filteredData.filter(
(meteor) => meteor.is_potentially_hazardous_asteroid
);
return { wereDangerousMeteors: dangerousMeteors.length > 0 };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot about filteredData

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

throw new Exception(500, "Failed to fetch data from NASA API");
}

const meteorsArray = meteorsData[startDate];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to take data from each date

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


const getMeteorsData = async ({ date, count, wereDangerousMeteors }) => {
const startDate = dateUtils.getStartDateOrDefault(date);
const endDate = dateUtils.getEndDateOrDefault(date, startDate);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date can be range of dates
I updated task description

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

return startDate || new Date().toISOString().split('T')[0];
}

exports.getEndDateOrDefault = function (endDate, startDate) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be consistent please in export approach

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants